home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_tripwire.idb / usr / freeware / lib / tripwire / CheckConfig.z / CheckConfig
Encoding:
Text File  |  1999-04-16  |  618 b   |  32 lines

  1. #!/bin/sh
  2. # "analyze" a config file 
  3. #
  4. # Lance Bailey <lrb@ctrg.rri.uwo.ca>
  5. #
  6.  
  7. if [ ".$1" = ".-v" ];then verbose="yes";shift
  8. else verbose="";fi
  9.  
  10. file="$1"
  11.  
  12. sed -e "s/#.*//" \
  13.     -e "/^$/d" \
  14.     -e "s=[^/]*\(/[^     ]*\).*=\1=" \
  15.     $file |
  16.     while read line
  17.     do if [ ! -s $line ];then
  18.            if [ $verbose ];then echo ${line}:    not found;fi
  19.            continue
  20.        fi
  21.     
  22.        case `ls -ld $line` in
  23.            d*) if [ $verbose ];then echo "${line}:    directory";fi ;;
  24.            l*) echo "${line}:    symlink";;
  25.            *)  if [ $verbose ];then echo "${line}:    file";fi ;;
  26.        esac
  27.     done
  28.  
  29. #
  30. # EOF
  31. #
  32.